# -*- coding:utf-8 -*-
from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import dataTableConstants

class DataTableSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DataTableSubDirectiveTree, self).__init__(parent)
        self.createDataTableSubTreeNode()

    def createDataTableSubTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "dataTable"
        self.setText(0, "数据表格")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.readingDataTableDirective, "获取数据表格内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.writingToDataTableDirective, "写入内容到数据表格")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.gettingRowCountOfDataTableDirective, "读取数据表格总行数")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.deletingRowDirective, "删除行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.deletingColumnDirective, "删除列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.clearDataTableDirective, "清空数据表格")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.circulatingDataTableDirective, "循环数据表格内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.importDataTableDirective, "数据表格导入")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.exportDataTableDirective, "数据表格导出")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataTableConstants.DataTableConstants.gettingColumnInfoDirective, "获取列信息")